﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using PQT.API;
using PQT.API.File;
using PQT.API.DataDefine.Sys;
using PQT.Common;
using cbmobile.BLC;
//using System.Data;
using System.Data.SqlClient;

namespace cbmobile.UserControl
{
    public partial class GioiThieu_List : CommonUserControl
    {
        

        protected void Page_Load(object sender, EventArgs e)
        {
        }


        private void GioiThieu_Save(string TieuDe, string NoiDung)
        {
            DataTable dt = new DataTable();
            string ConnectionString = @"data source=TRICONG-PC\SQLEXPRESS;initial catalog=WebDiDong;user id=sa;password=1234;multipleactiveresultsets=True;App=EntityFramework";
            SqlConnection Cnn = new SqlConnection(ConnectionString);
            try
            {
                Cnn.Open();
                DataSet ds = new DataSet();
                SqlCommand cmdUp = new SqlCommand("prc_GioiThieu", Cnn);
                cmdUp.CommandType = CommandType.StoredProcedure;
                cmdUp.Parameters.Add(new SqlParameter("@TieuDe", SqlDbType.NVarChar));
                cmdUp.Parameters.Add(new SqlParameter("@NoiDung", SqlDbType.NText));

                cmdUp.Parameters[0].Value = TieuDe;
                cmdUp.Parameters[1].Value = NoiDung;

                cmdUp.ExecuteNonQuery();
            }
            catch { }
            finally
            {
                if (Cnn.State == ConnectionState.Open)
                    Cnn.Close();
                Cnn.Dispose();
            }
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            
            GioiThieu_Save(txtTieuDe.Text + "", fckmlDescription.Value + "");
        }

        
    }
}